package day12;

public enum Season {
    SPRING("春天"){
        @Override
        public Season next(){
            return SUMMER;
        }
    },
    SUMMER("夏天"){
        @Override
        public Season next(){
            return AUTUMN;
        }
    },
    AUTUMN("秋天"){
        @Override
        public Season next(){
            return WINTER;
        }
    },
    WINTER("冬天"){
        @Override
        public Season next(){
            return SPRING;
        }
    };

    public String getSign(){
        return sign;
    }
    private String sign;

    Season(String sign){
        this.sign = sign;
    }

    public abstract Season next();

}
class TestSeason{
    public static void main(String[] args) {
        Season s = Season.WINTER;
        while(true){
            s = s.next();
            System.out.println(s.getSign());

            try{
                Thread.sleep(1000);
            }catch(InterruptedException e){
                e.printStackTrace();
            }
        }
    }
}
